//
//  ClassBtn.swift
//  SchoolDemo
//
//  Created by rimi on 16/10/16.
//  Copyright © 2016年 YQ. All rights reserved.
//

import UIKit
// MARK:- 题型类型枚举
enum TestType {
    case radio //单选
    case multiselect//多选
    case judge //判断
    
}
class ClassBtn: UIButton {

    // MARK:- 初始化方法
    init(btnType:TestType) {
        super.init(frame: CGRect())
        switch btnType {
        case .radio :
            layer.cornerRadius = 8
            layer.masksToBounds = true
            setBackgroundImage(UIImage(named:"ac_radio_unchecked"), for: UIControlState.normal)
            setImage(UIImage(named:"ac_radio_checked"), for: UIControlState.selected)
            
        case .multiselect:
            setBackgroundImage(UIImage(named:"ac_checked_no"), for: UIControlState.normal)
            setImage(UIImage(named:"ac_checked_gray_yes"), for: UIControlState.selected)
        case .judge:
            layer.cornerRadius = 8
            layer.masksToBounds = true
            setBackgroundImage(UIImage(named:"ac_radio_unchecked"), for: UIControlState.normal)
            setImage(UIImage(named:"ac_radio_checked"), for: UIControlState.selected)
            
        }
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
        
    }
    
}


